<?php
use think\facade\Route;
use app\api\traits\CommonTrait;

// 定义路由地址
Route::group('',function(){
    Route::get('xcx_qrcode', 'Htns/xcxQrcode');// 小程序二维码
    Route::get('product_qrcode', 'Htns/productQrcode');// 商品详情二维码
    Route::get('activity_list', 'Htns/activityList');// 商品参与活动列表

})->middleware(\think\middleware\AllowCrossDomain::class);

Route::get('test_data', 'Test/testData')->middleware(\think\middleware\AllowCrossDomain::class);// 测试-部门用户回款列表统计
Route::get('test_data_sum', 'Test/testDataSum')->middleware(\think\middleware\AllowCrossDomain::class);// 测试-部门回款列表统计
Route::get('test_depart', 'Test/testDepart')->middleware(\think\middleware\AllowCrossDomain::class);// 测试-部门多级分类列表

Route::get('test', 'Index/test')->middleware(\think\middleware\LoadLangPack::class);// 测试 多语言测试
Route::get('get_token', 'Index/getToken');// 生成token
Route::get('check_token', 'Index/checkToken');// 验证token
Route::get('send_sms', 'Index/sendSms');// 发送短信验证码
Route::get('demo', 'Index/demo');
Route::get('a', 'Index/a');
Route::get('b', 'Index/b');
Route::get('get_user', 'Index/getUser')->middleware(\app\middleware\CheckToken::class);// 测试 token校验
//当路由规则都不匹配的话，会路由到`miss`
Route::miss(function() {
    return CommonTrait::returnJson(40001 );
});